//
//  AUTabBarController.swift
//  AwesomeUMainModule_Example
//
//  Created by Miss_Special on 2018/4/11.
//  Copyright © 2018 CocoaPods. All rights reserved.
//

import UIKit

public class AUTabBarController: UITabBarController {
    
    override public func viewDidLoad() {
        super.viewDidLoad()
    }
    
}

extension AUTabBarController {
    
    /// 添加子控制器
    ///
    /// - Parameters:
    ///   - childController: 自控制器
    ///   - requireNav: 是否需要包装导航控制器
    func au_addChildViewController(_ childController: UIViewController,
                                   title: String,
                                   normalImage: UIImage,
                                   selectedImage: UIImage,
                                   isRequireNav requireNav: Bool = true) {
        
        childController.tabBarItem.title = title
        childController.tabBarItem.image = normalImage
        childController.tabBarItem.selectedImage = selectedImage
        if requireNav {
            let nav = AUNavController(rootViewController: childController)
            addChildViewController(nav)
        } else {
            addChildViewController(childController)
        }
    }
}
